<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>switch-if语句算四则运算</title>
	</head>
	<body>
		<script>
			var num1 = parseInt(prompt("亲，请您输入第一个整数"));
			var num2 = parseInt(prompt("1.+ 2.- 3.+ 4./"));
			var num3 = parseInt(prompt("亲，请您输入第二个整数"));
			switch(num3){
				case 1:
				alert(num1 + num2);
				break;
				
				case 2:
				alert(num1 - num2);
				break;
				
				case3:
				alert(num1 * num2);
				break;
				
				case4:
				alert(num1 / num2);
				break;
			}
		</script>
	</body>
</html>
